package org.travel_system.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.travel_system.mapper.PerformanceMapper;
import org.travel_system.pojo.Performance;
import org.travel_system.service.PerformanceService;

import java.util.List;

@Service
public class PerformanceServiceImpl implements PerformanceService {

    public final PerformanceMapper performanceMapper;

    @Autowired
    public PerformanceServiceImpl(PerformanceMapper performanceMapper) {
        this.performanceMapper = performanceMapper;
    }

    @Override
    public List<Performance> getPerformances() {
        return performanceMapper.getPerformances();
    }

    @Override
    public Performance getPerformanceByName(String name) {
        return performanceMapper.getPerformanceByName(name);
    }

    @Override
    public int addPerformance(Performance performance) {
        return performanceMapper.addPerformance(performance);
    }

    @Override
    public int updatePerformance(Performance performance) {
        return performanceMapper.updatePerformance(performance);
    }

    @Override
    public int deletePerformance(String name) {
        return performanceMapper.deletePerformance(name);
    }
}
